﻿@using Website.Models
@model Website.Models.Product

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Create","Product",FormMethod.Post,new{enctype="multipart/form-data"})) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Product</legend>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryID, "Category")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CategoryID)
            @Html.ValidationMessageFor(model => model.CategoryID)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.PriceLevelID, "PriceLevel")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PriceLevelID)
            @Html.ValidationMessageFor(model => model.PriceLevelID)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.ProductSizes)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ProductSizes)
            @Html.ValidationMessageFor(model => model.ProductSizes)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ProductCode)
            @Html.ValidationMessageFor(model => model.ProductCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MainImage)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MainImage, new { ImageFieldName = "MainImage" })
            @Html.ValidationMessageFor(model => model.MainImage)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.SmallImage)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SmallImage, new { ImageFieldName = "SmallImage" })
            @Html.ValidationMessageFor(model => model.SmallImage)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage1)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SubImage1, new { ImageFieldName = "SubImage1" })
            @Html.ValidationMessageFor(model => model.SubImage1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage2)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SubImage2, new { ImageFieldName = "SubImage2" })
            @Html.ValidationMessageFor(model => model.SubImage2)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SubImage3)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SubImage3, new { ImageFieldName = "SubImage3" })
            @Html.ValidationMessageFor(model => model.SubImage3)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Desc)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Desc)
            @Html.ValidationMessageFor(model => model.Desc)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
